package Ep04_String._0459;

public class Violent {
    public boolean repeatedSubstringPattern(String s) {
        if (s.length() == 1){
            return false;
        }
        for (int i = 1; i*2 <= s.length(); i++) {
            if (s.length() % i == 0){
                boolean match = true;
                for (int j = i; j < s.length(); j++) {
                    if (s.charAt(j) != s.charAt(j-i)){
                        match = false;
                        break;
                    }
                }
                if (match){
                    return true;
                }
            }
        }
        return false;
    }
}
